package com.idealighter.game.web.checklevel.fqzs.service.bo;

import java.util.HashMap;
import java.util.Map;

import lombok.Data;

@Data
public class FqzsCheckResultBo {
  private long betChips = 0L; // 下注金额
  private long winChips = 0L; // 赢的金币
  private Map<Integer, Long> rewardMap = new HashMap<Integer, Long>();
  private Map<Integer, Integer> iconCountMap = new HashMap<Integer, Integer>();

  public void addBetChips(long betChips) {
    this.betChips += betChips;
  }

  public void addWinChips(long winChips) {
    this.winChips += winChips;
  }

  public void addRewardMap(Integer icon, Long rewardChips) {
    Long oldValue = this.rewardMap.getOrDefault(icon, 0L);
    rewardMap.put(icon, oldValue + rewardChips);
  }

  /**
   * .
   * 
   * @param map .
   */
  public void addRewardMap(Map<Integer, Long> map) {
    if (map != null) {
      for (Integer key : map.keySet()) {
        Long oldValue = this.rewardMap.get(key);
        if (oldValue == null) {
          oldValue = 0L;
        }
        rewardMap.put(key, oldValue + map.get(key));
      }
    }
  }

  public void addIconCountMap(Integer icon) {
    Integer oldValue = this.iconCountMap.getOrDefault(icon, 0);
    iconCountMap.put(icon, oldValue + 1);
  }

  /**
   * 添加icon.
   * 
   * @Title addIconCountMap.
   */
  public void addIconCountMap(Map<Integer, Integer> map) {
    if (map != null) {
      for (Integer key : map.keySet()) {
        Integer oldValue = iconCountMap.getOrDefault(key, 0);
        iconCountMap.put(key, oldValue + map.get(key));
      }
    }
  }
}
